<%@LANGUAGE="JAVASCRIPT" CODEPAGE="65001"%>
<!--#include file="conn.asp"-->
<%
var user_name=Request.Form("user_name");
var user_id=Request.Form("user_id");

var idrs=Server.CreateObject("adodb.recordset");
var idsqlstr="select * from userinfo where user_name='"+user_name+"'";

idrs.open(idsqlstr,conn,1);

if(idrs.RecordCount==0)
{
	Response.Write("done=noname");
	Session("passed")=false;
}
else
{
	idrs.MoveFirst();
	var a=new String(user_id);
	var b=new String(idrs("user_id"));
	if(compareString(a,b))
	{
		Response.Write("done=ok");
		Session("passed")=true;
	}
	else
	{
		Response.Write("done=iderror");
	}
}
Response.Write("&user_id="+b+"&userid="+user_id);

idrs.close();
conn.close();
delete idrs;
delete conn;

function compareString(stra,strb)
{
	if(stra.length==strb.length)
	{
		for(var i=0;i<stra.length;i++)
		{
			if(stra.charAt(i)!=strb.charAt(i))
			{
				return false;
			}
		}
	}
	else
	{
		return false;
	}
	return true;
}
%>